import api from "@/util/api";

const studentsApi = {
  findAll(pageNum, size, params = {}) {
    return api
      .get("/students", {
        //发送请求
        params: {
          pageNum,
          size,
          ...params,
        },
      })
      .then((resp) => resp.data);
  },
  removeAll(ids) {
    return api.delete("/students", { data: ids }).then((resp) => resp.data);
  },
  save(students) {
    return api.post("/students", students).then((resp) => resp.data);
  },
  update(students) {
    return api.put("/students", students).then((resp) => resp.data);
  }
  , resetPasswordAll(ids) {
    return api.post("/students/resetPassword", ids).then((resp) => resp.data);
  },findByUserName(username) {
    return api.get("/students/username/"+username).then((resp) => resp.data);
  },
  login(account) {
    return api.post("/students/login", account).then((resp) => resp.data);
  }

};

export default studentsApi;
